Skip to content

Fixing cluster stats response #4632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 17, 2025
Merged

Fixing cluster stats response #4632

merged 11 commits into from
Jul 17, 2025

Conversation

l-trotta
Copy link
Contributor

@l-trotta l-trotta commented Jun 19, 2025

From 0/27 validated responses to 27/27. Providing server side proof for each of these changes would be a lot, most of these changes are adding the in_bytes (or not in_bytes) alternative for fields and making both optional.
New classes:

Since it was broken before I think this can all be backported safely

About FieldTypes: In the server code there is a parent class IndexFeatureStats which is extended by DenseVectorFieldStats, the specific class to hold dense vector related fields. Currently we cannot have the same distinction, because it would be one of those unions which are hard to deserialize (no unique subset of fields) and also it would introduce breaking changes.

Copy link
Contributor

github-actions bot commented Jun 19, 2025

Following you can find the validation changes against the target branch for the APIs.

API Status Request Response
cluster.stats 🔴 → 🟢 27/27 0/27 → 27/27
nodes.stats 🔴 58/58 18/58 → 21/58

You can validate these APIs yourself by using the make validate target.

@l-trotta
Copy link
Contributor Author

nodes.stats will also be fixed, but this one and the other one need to be merged first

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In SegmentStats, I'm seeing (existing) fields that I would not expect:

  • index_writer_max_memory_in_bytes?: long
  • stored_memory?: ByteSize

In StatsResponseBase:

In ClusterFileSystem, there are other optional fields

Still need to finish reviewing types.ts and Stats.ts.

@l-trotta
Copy link
Contributor Author

In SegmentStats, I'm seeing (existing) fields that I would not expect:

* index_writer_max_memory_in_bytes?: long

* stored_memory?: ByteSize

nice catch, removing those

In StatsResponseBase:

* `status` appears to be optional

* should we add [ESQL metrics](https://github.com/elastic/elasticsearch/blob/c94bd1cf248bff8e37ea7dc652d19eacfe8fef05/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsResponse.java#L162-L166)?

status is optional yes, while _esql we already have, it's in ccs

In ClusterFileSystem, there are other optional fields

adding them, thank you!

@elastic elastic deleted a comment from github-actions bot Jul 1, 2025
Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In ClusterIndices, mappings is optional, as well as analysis

In FieldTypesMappings, total_field_count and total_deduplicated_field_count are long.

In FieldTypes, indexed_vector_count is a long. However, should we call it DenseVectorFieldStats? FieldStats is a different child class in the Java code.

All fields built with humanReadableField are marked optional, but I don't understand why when reading the code.

Comment on lines 166 to 177
export class DenseVectorOffHeapStats {
total_size_bytes?: long
total_size?: ByteSize
total_veb_size_bytes?: long
total_veb_size?: ByteSize
total_vec_size_bytes?: long
total_vec_size?: ByteSize
total_veq_size_bytes?: long
total_veq_size?: ByteSize
total_vex_size_bytes?: long
total_vex_size?: ByteSize
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah thanks I forgot about this one! I'm not sure how to map it since it's all custom field values, let's discuss it with the team

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added it!

@l-trotta
Copy link
Contributor Author

@pquentin thanks for the review! I think I addressed everything

@l-trotta
Copy link
Contributor Author

nodes.stats is next

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM.

@l-trotta l-trotta merged commit ddc225d into main Jul 17, 2025
8 checks passed
@l-trotta l-trotta deleted the fix-cluster-stats-resp branch July 17, 2025 13:31
github-actions bot pushed a commit that referenced this pull request Jul 17, 2025
* fixing cluster stats response

* addressing review with more fixes

* update healthstatus enums

* addressing review

* add fielddata, more comments

* fix type dense vector fields

* fixed raw values not nullable

---------

Co-authored-by: Quentin Pradet <[email protected]>
(cherry picked from commit ddc225d)
github-actions bot pushed a commit that referenced this pull request Jul 17, 2025
* fixing cluster stats response

* addressing review with more fixes

* update healthstatus enums

* addressing review

* add fielddata, more comments

* fix type dense vector fields

* fixed raw values not nullable

---------

Co-authored-by: Quentin Pradet <[email protected]>
(cherry picked from commit ddc225d)
github-actions bot pushed a commit that referenced this pull request Jul 17, 2025
* fixing cluster stats response

* addressing review with more fixes

* update healthstatus enums

* addressing review

* add fielddata, more comments

* fix type dense vector fields

* fixed raw values not nullable

---------

Co-authored-by: Quentin Pradet <[email protected]>
(cherry picked from commit ddc225d)
github-actions bot pushed a commit that referenced this pull request Jul 17, 2025
* fixing cluster stats response

* addressing review with more fixes

* update healthstatus enums

* addressing review

* add fielddata, more comments

* fix type dense vector fields

* fixed raw values not nullable

---------

Co-authored-by: Quentin Pradet <[email protected]>
(cherry picked from commit ddc225d)
l-trotta added a commit that referenced this pull request Jul 17, 2025
* fixing cluster stats response

* addressing review with more fixes

* update healthstatus enums

* addressing review

* add fielddata, more comments

* fix type dense vector fields

* fixed raw values not nullable

---------


(cherry picked from commit ddc225d)

Co-authored-by: Laura Trotta <[email protected]>
Co-authored-by: Quentin Pradet <[email protected]>
l-trotta added a commit that referenced this pull request Jul 17, 2025
* fixing cluster stats response

* addressing review with more fixes

* update healthstatus enums

* addressing review

* add fielddata, more comments

* fix type dense vector fields

* fixed raw values not nullable

---------


(cherry picked from commit ddc225d)

Co-authored-by: Laura Trotta <[email protected]>
Co-authored-by: Quentin Pradet <[email protected]>
l-trotta added a commit that referenced this pull request Jul 17, 2025
* fixing cluster stats response

* addressing review with more fixes

* update healthstatus enums

* addressing review

* add fielddata, more comments

* fix type dense vector fields

* fixed raw values not nullable

---------


(cherry picked from commit ddc225d)

Co-authored-by: Laura Trotta <[email protected]>
Co-authored-by: Quentin Pradet <[email protected]>
l-trotta added a commit that referenced this pull request Jul 17, 2025
* fixing cluster stats response

* addressing review with more fixes

* update healthstatus enums

* addressing review

* add fielddata, more comments

* fix type dense vector fields

* fixed raw values not nullable

---------


(cherry picked from commit ddc225d)

Co-authored-by: Laura Trotta <[email protected]>
Co-authored-by: Quentin Pradet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants